package com.course.web.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Min;

/**
 * Created by Justin on 2017/6/9.
 */
@Data
@EqualsAndHashCode(of = {"courseId", "weekIdx", "partIdx"})
public class CourseWeekVM {
    @Min(0)
    private final int courseId;
    @Min(0)
    private final int weekIdx;
    @Min(0)
    private final int partIdx;
    @NotEmpty
    private String workday;
    @NotEmpty
    private String weekend;
    private CourseItemVM[] items;

    public CourseItemVM getItem(int weedDay) {
        return items[weedDay];
    }

    public void setItem(int weekDay, CourseItemVM item) {
        items[weekDay] = item;
    }
}
